<template>
	<view>
		<view class="swiperBox">	
			<swiper :indicator-dots="true" :autoplay="true" :interval="2500" :duration="1000">
				<swiper-item v-for="(item,index) in imgUrl" :key="item.id" @click="toImgDetail(item.id,item.type)">
					<view class="swiper-item">
						<image :src="item.url" mode="" ></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:'swiper-temp',
		props:{
			imgUrl:Array
		},
		data() {
			return {
				
			};
		},
		methods:{
			tap(){
				console.log(JSON.stringify(this.imgUrl))
			},
			toImgDetail(id,type) {
				console.log("轮播图跳转ID\\\\\\\\\\\\\\"+id+"~~~~~~~"+type);
				id = '20190117165221535501644243140608';
				if(type == "02"){//即为资讯跳转
					uni.navigateTo({
						url:'/pages/index/news/info/info?newsid='+id
					})
				}else{
					//暂时弹框提示
					uni.showLoading({
						title: '敬请期待！'
					});
					setTimeout(function () {
						uni.hideLoading();
					}, 1000);
				}
				/* uni.navigateTo({
					url: 'caifu/caifu',
					success: res => {},
					fail: () => {},
					complete: () => {}
				}); */
			}
		}
	}
</script>

<style>
	.swiperBox {
			width: 100%;
			height: 420upx;
	
		}
	
		swiper,.swiper-item {
			height: 100%;
		}
	
		.swiper-item image {
			width: 100%;
			height: 100%;
	
		}
</style>
